Add config drift comparison tool for YAML merge - #2
Open
npeham wants to merge 2 commits into
Open
Conversation
Add a dedicated /configuration/diff page where a librechat.yaml can be pasted and compared against the values currently configured in LibreChat (base-file overrides + admin-panel DB overrides). Configured leaf paths missing from the pasted YAML are folded in as "drift" additions and the page emits a single valid merged YAML with a copy button, ready to save. When the pasted YAML and LibreChat disagree on a field, the merge is blocked and every conflicting field is listed with both values so it can be resolved in the source YAML. - computeConfigDrift / buildConfiguredValues utilities (+ unit tests) - parseConfigYamlFn server fn validating YAML against configSchema and returning the literal parsed values (no schema defaults injected) - ConfigDiffPage UI and route, "Compare & merge" header action
railway-app
Bot
temporarily deployed
to
Proactive - AI Hub - Demo / test
June 2, 2026 11:37
Inactive
Make the compare & merge tool actionable instead of read-only: - Per-conflict resolution: each conflicting field offers a "Your YAML" vs "LibreChat" choice (plus keep-all shortcuts). The merged YAML is built live from the chosen sides and is only produced once every conflict is resolved. - The merged result can be copied, downloaded as librechat.yaml, or applied directly to LibreChat via the admin panel (full base-config replace, gated by MANAGE_CONFIGS). Splits the merge out of computeConfigDrift into buildMergedConfig(pasted, additions, conflicts, resolutions) and updates the unit tests accordingly.
railway-app
Bot
temporarily deployed
to
Proactive - AI Hub - Demo / test
June 2, 2026 12:33
Inactive
railway-app
Bot
temporarily deployed
to
Proactive - AI Hub - Demo / feature-dev
June 2, 2026 13:13
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new "Compare & merge" feature to the configuration panel that allows users to paste a
librechat.yamlfile and compare it against the values currently configured in LibreChat. The tool identifies:When no conflicts exist, users receive a single merged YAML ready to save, combining their pasted config with all currently configured values.
Change Type
Implementation Details
New Components & Routes
ConfigDiffPage(src/components/configuration/ConfigDiffPage.tsx): Main UI component with two-column layout (input YAML on left, results on right)/configuration/diffwith permission checks matching the main configuration pageCore Logic
computeConfigDrift()(src/utils/drift.ts): Compares pasted config against configured values, identifies conflicts/additions, and produces merged resultbuildConfiguredValues()(src/utils/drift.ts): Aggregates currently configured values from file config and database overridesparseConfigYamlFn()(src/server/config.ts): Server function that parses and validates pasted YAML, returning literal parsed values (not AppService-expanded) for accurate comparisonTypes
src/types/drift.tswith interfaces for conflicts, additions, and drift resultsUI Integration
Testing
computeConfigDrift()andbuildConfiguredValues()covering:Testing
Run unit tests:
bun test src/utils/drift.test.tsManual testing:
librechat.yamlor upload a fileChecklist
https://claude.ai/code/session_01NPqLTVpwriTqEc91NkjSsz